unit fmNewRole;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, fmNormal, StdCtrls, Mask, DBCtrlsEh, Buttons,dmUserPurview;

type
  TfrmNewRole = class(TfrmNormal)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    edtRoleCode: TDBEditEh;
    edtRoleName: TDBEditEh;
    edtRoleRemark: TDBEditEh;
    btnCreate: TBitBtn;
    btnClose: TBitBtn;
    procedure edtRoleCodeChange(Sender: TObject);
    procedure btnCreateClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmNewRole: TfrmNewRole;

implementation


{$R *.dfm}

procedure TfrmNewRole.edtRoleCodeChange(Sender: TObject);
begin
  inherited;
  if Length(edtRoleCode.Text)>0 then
    btnCreate.Enabled := True
  else btnCreate.Enabled := False;
end;

procedure TfrmNewRole.btnCreateClick(Sender: TObject);
begin
  inherited;
  dtmUserPurview.NewRole('', edtRoleCode.Text, edtRoleName.Text, edtRoleRemark.Text);
  ModalResult := mrOk;
end;

end.
